/*
    Copyright (C) 2010-2011 mdis
    
    This file is part of mdis.
    Written by Ketfi-Chérif Mehdi <ketficherif.mehdi@gmail.com>

    mdis is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    mdis is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with mdis.  If not, see <http://www.gnu.org/licenses/>.

*/

#ifndef _TUI_H
#define _TUI_H

/* Main terminal user interface functions. */
void tui_init ( void );
void tui_init_colors ( void );
void tui_close ( void );

/* Various window functions. */
void tui_wframe ( WINDOW *window , uint16_t width , uint16_t height );
void tui_whsplit ( WINDOW *window , uint16_t width , uint16_t y );
void tui_msgbox ( char * msg );

/* Static text item. */
pstatic_text_t tui_static_text_create ( uint16_t width , uint16_t height ,
	       				uint16_t xp , uint16_t yp , int attrib ,
					int16_t bkgd_color , uint8_t format , char * str );
void tui_static_text_show ( pstatic_text_t st );
void tui_static_text_destroy ( pstatic_text_t st );

/* Main window functions. */
pmwindow_t tui_mwindow_create ( uint16_t width , uint16_t height , uint16_t xpos ,
		 		uint16_t ypos , char *title );
void tui_mwindow_set_title ( pmwindow_t mwin , char *title );
void tui_mwindow_show ( pmwindow_t mwin );
void tui_mwindow_print ( pmwindow_t mwin , char *str );
void tui_mwindow_destroy ( pmwindow_t mwin );

/* Lisview item. */
ptui_listview_t tui_listview_create ( WINDOW * parent , uint16_t width , uint16_t height ,
				      uint16_t xpos , uint16_t ypos );
void tui_listview_add_item ( ptui_listview_t listview , char * item );
void tui_listview_show ( ptui_listview_t listview );
void tui_listview_set_focus ( ptui_listview_t listview , uint8_t focus );
void tui_listview_select_next ( ptui_listview_t listview );
void tui_listview_select_prev ( ptui_listview_t listview );
void tui_listview_select_snext ( ptui_listview_t listview );
void tui_listview_select_sprev ( ptui_listview_t listview );
void tui_listview_destroy ( ptui_listview_t listview );

/* Hexadecimal view item. */
ptui_hexview_t tui_hexview_create ( WINDOW * parent , uint16_t width , uint16_t height ,
		 	uint16_t xpos , uint16_t ypos );
void tui_hexview_set ( ptui_hexview_t hv , uint8_t * buffer , uint16_t size );
void tui_hexview_show ( ptui_hexview_t hv );
void tui_hexview_up ( ptui_hexview_t hv );
void tui_hexview_down ( ptui_hexview_t hv );
void tui_hexview_right ( ptui_hexview_t hv );
void tui_hexview_left ( ptui_hexview_t hv );
void tui_hexview_set_focus ( ptui_hexview_t hv , uint8_t focus );
void tui_hexview_destroy ( ptui_hexview_t hv );

#endif

